<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">

<title> 提交记录 6127 - Judge Duck Online </title>

<link rel="icon" type="image/png" href="/images/judgeduck-logo-small.png" />

<script src="/libs/js/jquery-3.2.1.min.js"></script>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="/libs/css/bootstrap.min.css" />

<!-- Latest compiled and minified JavaScript -->
<script src="/libs/js/bootstrap.min.js"></script>

<link rel="stylesheet" type="text/css" href="/css/main.css" />
<link rel="stylesheet" href="/css/non-responsive.css" type="text/css" />

<script src="/js/md5.js"></script>
<script src="/js/judgeduck.js"></script>

<script type="text/x-mathjax-config">
	MathJax.Hub.Config({
		showProcessingMessages: false,
		tex2jax: {
			inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],
			processEscapes:true
		},
		menuSettings: {
			zoom: "Hover"
		}
	});
</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>

</head>

<body onload="">

<!-- Fixed navbar -->
<nav class="navbar navbar-default" role="navigation" style="background-color: #eeeeee">
	<div class="container">
		<div class="navbar-header">
			<div class="navbar-brand">
				<a href="/">
					<img src="/images/judgeduck-logo.png" width="40px" height="40px" style="margin:-10px" />
				</a>
			</div>
			<font class="navbar-brand">
				Judge Duck Online
			</font>
		</div>
		<div class="navbar-collapse collapse">
			<ul class="nav navbar-nav">
				<li class="nav-item">
					<a class="nav-link" href="/index/index.html"> 首页 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/problems/index.html"> 题目列表 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/submissions/index.html"> 提交记录 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/blogs/index.html"> 博客 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/faq/index.html"> FAQ </a>
				</li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<li class="nav-item">
					<a class="nav-link" href="/user/login/index.html"> 登录 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/user/register/index.html"> 注册 </a>
				</li>
			</ul>
		</div><!--/.nav-collapse -->
	</div>
</nav>




<div id="main_div" class="container" style="padding-left: 25px; padding-right: 25px">
	<h2> 提交记录 6127 </h2>
	<hr />
	
	<div class="row">
		<div class="col-xs-12">
			<table class="table table-bordered">
				<tr>
					<th class="col-xs-2"> 用户 </th>
					<th class="col-xs-3"> 题目 </th>
					<th class="col-xs-2"> 状态 </th>
					<th class="col-xs-1"> 得分 </th>
					<th class="col-xs-1"> 用时 </th>
					<th class="col-xs-1"> 内存 </th>
					<th class="col-xs-1"> 语言 </th>
					<th class="col-xs-1"> 代码长度 </th>
				</tr>
				<tr>
					<td style='font-size:13px'> <a href='/user/profile/nqiiii/index.html'> nqiiii </a> </td>
<td> <a href='/problem/1001/index.html'> 1001. 测测你的排序 </a>
<a href="http://www.iis7.com" id="3df51f491d6b4f4fa17e89f1137b6049" style="display:inline-block;background-color:;color:#fff;padding:2px 5px;font-family:arial;font-size:12px;font-weight:bold;" target="_blank" class="3df51f491d6b4f4fa17e89f1137b6049" >iis7站长之家</a> </td>
<td> Accepted </td>
<td> 100 </td>
<td style='font-size:13px'> 957.211 ms </td>
<td style='font-size:13px'> 762 MB + 992 KB </td>
<td style='font-size:13px'> C++11 </td>
<td style='font-size:13px'> 4.95 KB </td>
				</tr>
			</table>
			<table class="table table-bordered">
				<tr>
					<th class="col-xs-6"> 提交时间 </th>
					<th class="col-xs-6"> 评测时间 </th>
				</tr>
				<tr>
					<td style='font-size:13px'> 2018-09-27 09:46:27 </td>
<td style='font-size:13px'> 2019-01-19 13:58:59 </td>
				</tr>
			</table>
			<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/styles/tomorrow.min.css">
			<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js"></script>
			<script>hljs.initHighlightingOnLoad();</script>
			<div class="row">
				<label for="code"> 代码 </label>
				<pre style="background-color:white"><code class="cpp">#if defined(__GNUC__) &amp;&amp; !defined(__clang__)
#define O2 __attribute__((optimize(&quot;-O2&quot;)))
#else
#define O2
#endif

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#define BUCKET_MOD (0xFFU)
#define BUCKET_SIZE (BUCKET_MOD + 1U)
#ifndef MAX_SIZE
#define MAX_SIZE (100000000U)
#endif

#define SPLIT_LOOP_1(p, key, mod, value, index)     \
*(--(key[value[index] mod].addr)) = value[index]
#define SPLIT_LOOP_2(p, key, mod, value, index)     \
SPLIT_LOOP_1(p, key, mod, value, index + 1);        \
SPLIT_LOOP_1(p, key, mod, value, index)
#define SPLIT_LOOP_4(p, key, mod, value, index)     \
SPLIT_LOOP_2(p, key, mod, value, index + 2);        \
SPLIT_LOOP_2(p, key, mod, value, index)
#define _SPLIT_LOOP_8_(p, key, mod, value)          \
SPLIT_LOOP_4(p, key, mod, value, 4);                \
SPLIT_LOOP_4(p, key, mod, value, 0)

#define ADD_LOOP_1(key, mod, v1)                    \
++key[v1 mod].offset
#define ADD_LOOP_2(key, mod, v1, v2)                \
ADD_LOOP_1(key, mod, v1);                           \
ADD_LOOP_1(key, mod, v2)
#define ADD_LOOP_4(key, mod, v1, v2, v3, v4)        \
ADD_LOOP_2(key, mod, v1, v2);                       \
ADD_LOOP_2(key, mod, v3, v4)
#define ADD_LOOP_8(key, mod, v1, v2, v3, v4, v5, v6, v7, v8)    \
ADD_LOOP_4(key, mod, v1, v2, v3, v4)                \
ADD_LOOP_4(key, mod, v5, v6, v7, v8)

#define SPLIT_END_LOOP(dst, src, end, key, mod, p)  \
for (p = end; p &gt; src; ) {                          \
    p -= 8;                                         \
    _SPLIT_LOOP_8_(dst, key, mod, p);               \
}
#define SPLIT_LOOP(dst, src, size, key, mod, p)     \
SPLIT_END_LOOP(dst, src, src + size, key, mod, p)
#define SPLIT_END_NOLOOP(dst, src, end, key, mod, p)\
for (p = end; p &gt; src; ) {                          \
    register sort_t tmp = *(--p);                   \
    *(--key[tmp mod].addr) = tmp;                   \
}
#define SPLIT_NOLOOP(dst, src, size, key, mod, p)   \
SPLIT_END_NOLOOP(dst, src, src + size, key, mod, p)

#ifndef LOOP
#define SPLIT(dst, src, size, key, mod, p)          \
SPLIT_LOOP(dst, src, size, key, mod, p)
#else
#define SPLIT(dst, src, size, key, mod, p)          \
SPLIT_NOLOOP(dst, src, size, key, mod, p)
#endif

#define CAL_OFFSET_INIT(key, init, begin)           \
key[init].addr = begin + key[init].offset;
#define CAL_OFFSET(key, i)                          \
key[i].addr = key[i - 1].addr + key[i].offset

typedef unsigned sort_t;
typedef union int_p_t {
    unsigned int offset;
    sort_t* addr;
} int_p_t;
// sort_t arr[MAX_SIZE];

#define LSB_SORT(dst, src, dst_end, src_end) do {                                   \
    int_p_t k2[BUCKET_SIZE] = {0}, k3[BUCKET_SIZE] = {0}, k4[BUCKET_SIZE] = {0};    \
    sort_t *p = src;                                                                \
    for (; p &lt; src_end; ) {                                                         \
        register sort_t tmp = *(p++);                                               \
        ADD_LOOP_1(k4, &amp; BUCKET_MOD, tmp);                                          \
        ADD_LOOP_1(k3, &gt;&gt; 8 &amp; BUCKET_MOD, tmp);                                     \
        ADD_LOOP_1(k2, &gt;&gt; 16 &amp; BUCKET_MOD, tmp);                                    \
    }                                                                               \
    CAL_OFFSET_INIT(k4, 0, dst);                                                    \
    CAL_OFFSET_INIT(k3, 0, src);                                                    \
    CAL_OFFSET_INIT(k2, 0, dst);                                                    \
    for (unsigned int i = 1; i &lt; BUCKET_SIZE; ++i) {                                \
        CAL_OFFSET(k4, i);                                                          \
        CAL_OFFSET(k3, i);                                                          \
        CAL_OFFSET(k2, i);                                                          \
    }                                                                               \
    SPLIT_END_NOLOOP(dst, src, src_end, k4, &amp; BUCKET_MOD, p);                       \
    SPLIT_END_NOLOOP(src, dst, dst_end, k3, &gt;&gt; 8 &amp; BUCKET_MOD, p);                  \
    SPLIT_END_NOLOOP(dst, src, src_end, k2, &gt;&gt; 16 &amp; BUCKET_MOD, p);                 \
} while(0)

O2 void sort(sort_t *data, int n) {
    int_p_t k1[BUCKET_SIZE] = {0};
    sort_t *arr = (sort_t*)malloc(sizeof(data[0]) * n);
    sort_t *p = data, *end = data + n;
    for (; p &lt; end; ) {
        register sort_t tmp = p[0], tmp_ = p[1], tmp__ = p[2], tmp___ = p[3];
        ADD_LOOP_4(k1, &gt;&gt; 24, tmp, tmp_, tmp__, tmp___);
        p += 4;
    }
    CAL_OFFSET_INIT(k1, 0, arr);
    for (unsigned int i = 1; i &lt; BUCKET_SIZE; ++i) {
        CAL_OFFSET(k1, i);
    }

    SPLIT(arr, data, n, k1, &gt;&gt; 24, p);
    end = arr + n;
    sort_t* data_end = data + n;
    for (unsigned int i = BUCKET_SIZE; i; ) {
        sort_t* begin = k1[--i].addr;
        sort_t* data_begin = data_end - (end - begin);
        LSB_SORT(data_begin, begin, data_end, end);
        data_end = data_begin;
        end = begin;
    }
    
    free(arr);
}</code></pre>
				<br />
				
				<label for="result"> 评测结果 </label><div class="row"><div class="col-xs-12"><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Compilation</b></td><td class="col-xs-2" style="vertical-align:middle">N/A</td><td class="col-xs-2" style="vertical-align:middle">N/A</td><td class="col-xs-2" style="vertical-align:middle">Compile OK</td><td class="col-xs-2" style="vertical-align:middle">Score: N/A</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_1" aria-expanded="false" aria-controls="detail_1">显示更多</a></td></tr></table></div><div class="collapse" id="detail_1"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>Compiling...
Compile success!
</textarea></div></div><div class="alert alert-success"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Testcase #1</b></td><td class="col-xs-2" style="vertical-align:middle">957.211 ms</td><td class="col-xs-2" style="vertical-align:middle">762 MB + 992 KB</td><td class="col-xs-2" style="vertical-align:middle">Accepted</td><td class="col-xs-2" style="vertical-align:middle">Score: 100</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_2" aria-expanded="false" aria-controls="detail_2">显示更多</a></td></tr></table></div><div class="collapse" id="detail_2"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>verdict = Run Finished
time_ms = 957.211096
mem_kb = 781280
Correct Answer
</textarea></div></div></div></div>
			</div>
		</div>
	</div>

	<hr />
	
	<div class="row">
		<p style="text-align: center; color: #888">
			Judge Duck Online | 评测鸭在线 <br />
			Server Time: 2019-08-02 17:12:23 | Loaded in 1 ms | <a href="/status/index.html"> Server Status </a> <br />
			个人娱乐项目，仅供学习交流使用
		</p>
	</div>
</div>

</body>

</html>
